package com.dong.thrift.user.dto;

import com.dong.thrift.user.UserInfo;

public class TeacherDTO extends  UserDTO{
    private String intro;
    private int stars;

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    public int getStars() {
        return stars;
    }

    public void setStars(int stars) {
        this.stars = stars;
    }

    public TeacherDTO() {
    }
    public TeacherDTO(UserDTO userDTO) {
        this.setEmail(userDTO.getEmail());
        this.setId(userDTO.getId());
        this.setMobile(userDTO.getMobile());
        this.setUsername(userDTO.getUsername());
        this.setRealName(userDTO.getRealName());
        this.setPassword(userDTO.getPassword());
    }

    /************************************************************************/
    public static TeacherDTO convertUserInfo2TeacherDto(UserInfo userInfo) {
        System.out.println(userInfo);
        String intro = userInfo.getIntro();
        int stars = userInfo.getStars();
        TeacherDTO teacherDTO = new TeacherDTO(UserDTO.toDto(userInfo));
        teacherDTO.setStars(stars);
        teacherDTO.setIntro(intro);
        return teacherDTO;
    }
}
